import request from '../utils/request'

// 用户登录相关接口
const userApi = {
	// 账号密码登录
	loginByAccount(data, key, code) {
		return request.post('/user-service/user/login?key=' +
			key + '&code=' + code, data)
	},

	// 手机号登录
	phoneLogin(phone,code) {
		return request.get('/user-service/user/phoneLogin?phone='+ phone + '&code=' + code)
	},

	// 获取手机验证码
	getPhoneVerifyCode(phone) {
		return request.get(`/user-service/user/getPhoneCode?phone=${phone}`)
	},

	// 获取图片验证码
	getImageVerifyCode(key) {
		return request.get('/user-service/user/getCode?key=' + key)
	},

	//上传身份证
	uploadIDCard(file) {
		return request.post('/upload-service/recognition/uploadIdNum', file)
	},

	//用户注册
	register(data) {
		return request.post('/user-service/user/register', data)
	},
	
	// 重置密码
	resetPassword(data) {
		return request.post('/user-service/user/resetPassword', data)
	},
	
	//短信验证登录
	// smsLogin()
}

export default userApi